/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.einstein.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Tobe
 */
@Entity
@Table(name = "saldo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Saldo.findAll", query = "SELECT s FROM Saldo s"),
    @NamedQuery(name = "Saldo.findByAnoProc", query = "SELECT s FROM Saldo s WHERE s.saldoPK.anoProc = :anoProc"),
    @NamedQuery(name = "Saldo.findByCodProd", query = "SELECT s FROM Saldo s WHERE s.saldoPK.codProd = :codProd"),
    @NamedQuery(name = "Saldo.findByMesProc", query = "SELECT s FROM Saldo s WHERE s.saldoPK.mesProc = :mesProc"),
    @NamedQuery(name = "Saldo.findByCCredito", query = "SELECT s FROM Saldo s WHERE s.cCredito = :cCredito"),
    @NamedQuery(name = "Saldo.findByCDebito", query = "SELECT s FROM Saldo s WHERE s.cDebito = :cDebito"),
    @NamedQuery(name = "Saldo.findByCFinal", query = "SELECT s FROM Saldo s WHERE s.cFinal = :cFinal"),
    @NamedQuery(name = "Saldo.findByCInicial", query = "SELECT s FROM Saldo s WHERE s.cInicial = :cInicial"),
    @NamedQuery(name = "Saldo.findByCfCredito", query = "SELECT s FROM Saldo s WHERE s.cfCredito = :cfCredito"),
    @NamedQuery(name = "Saldo.findByCfDebito", query = "SELECT s FROM Saldo s WHERE s.cfDebito = :cfDebito"),
    @NamedQuery(name = "Saldo.findByCfFinal", query = "SELECT s FROM Saldo s WHERE s.cfFinal = :cfFinal"),
    @NamedQuery(name = "Saldo.findByCfInicial", query = "SELECT s FROM Saldo s WHERE s.cfInicial = :cfInicial"),
    @NamedQuery(name = "Saldo.findByClCredito", query = "SELECT s FROM Saldo s WHERE s.clCredito = :clCredito"),
    @NamedQuery(name = "Saldo.findByClDebito", query = "SELECT s FROM Saldo s WHERE s.clDebito = :clDebito"),
    @NamedQuery(name = "Saldo.findByClFinal", query = "SELECT s FROM Saldo s WHERE s.clFinal = :clFinal"),
    @NamedQuery(name = "Saldo.findByClInicial", query = "SELECT s FROM Saldo s WHERE s.clInicial = :clInicial"),
    @NamedQuery(name = "Saldo.findByCompaniaId", query = "SELECT s FROM Saldo s WHERE s.saldoPK.companiaId = :companiaId")})
public class Saldo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SaldoPK saldoPK;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "c_credito")
    private BigDecimal cCredito;
    @Column(name = "c_debito")
    private BigDecimal cDebito;
    @Column(name = "c_final")
    private BigDecimal cFinal;
    @Column(name = "c_inicial")
    private BigDecimal cInicial;
    @Column(name = "cf_credito")
    private BigDecimal cfCredito;
    @Column(name = "cf_debito")
    private BigDecimal cfDebito;
    @Column(name = "cf_final")
    private BigDecimal cfFinal;
    @Column(name = "cf_inicial")
    private BigDecimal cfInicial;
    @Column(name = "cl_credito")
    private BigDecimal clCredito;
    @Column(name = "cl_debito")
    private BigDecimal clDebito;
    @Column(name = "cl_final")
    private BigDecimal clFinal;
    @Column(name = "cl_inicial")
    private BigDecimal clInicial;
    @JoinColumn(name = "compania_id", referencedColumnName = "id", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Compania compania;

    public Saldo() {
    }

    public Saldo(SaldoPK saldoPK) {
        this.saldoPK = saldoPK;
    }

    public Saldo(int anoProc, String codProd, int mesProc, int companiaId) {
        this.saldoPK = new SaldoPK(anoProc, codProd, mesProc, companiaId);
    }

    public SaldoPK getSaldoPK() {
        return saldoPK;
    }

    public void setSaldoPK(SaldoPK saldoPK) {
        this.saldoPK = saldoPK;
    }

    public BigDecimal getCCredito() {
        return cCredito;
    }

    public void setCCredito(BigDecimal cCredito) {
        this.cCredito = cCredito;
    }

    public BigDecimal getCDebito() {
        return cDebito;
    }

    public void setCDebito(BigDecimal cDebito) {
        this.cDebito = cDebito;
    }

    public BigDecimal getCFinal() {
        return cFinal;
    }

    public void setCFinal(BigDecimal cFinal) {
        this.cFinal = cFinal;
    }

    public BigDecimal getCInicial() {
        return cInicial;
    }

    public void setCInicial(BigDecimal cInicial) {
        this.cInicial = cInicial;
    }

    public BigDecimal getCfCredito() {
        return cfCredito;
    }

    public void setCfCredito(BigDecimal cfCredito) {
        this.cfCredito = cfCredito;
    }

    public BigDecimal getCfDebito() {
        return cfDebito;
    }

    public void setCfDebito(BigDecimal cfDebito) {
        this.cfDebito = cfDebito;
    }

    public BigDecimal getCfFinal() {
        return cfFinal;
    }

    public void setCfFinal(BigDecimal cfFinal) {
        this.cfFinal = cfFinal;
    }

    public BigDecimal getCfInicial() {
        return cfInicial;
    }

    public void setCfInicial(BigDecimal cfInicial) {
        this.cfInicial = cfInicial;
    }

    public BigDecimal getClCredito() {
        return clCredito;
    }

    public void setClCredito(BigDecimal clCredito) {
        this.clCredito = clCredito;
    }

    public BigDecimal getClDebito() {
        return clDebito;
    }

    public void setClDebito(BigDecimal clDebito) {
        this.clDebito = clDebito;
    }

    public BigDecimal getClFinal() {
        return clFinal;
    }

    public void setClFinal(BigDecimal clFinal) {
        this.clFinal = clFinal;
    }

    public BigDecimal getClInicial() {
        return clInicial;
    }

    public void setClInicial(BigDecimal clInicial) {
        this.clInicial = clInicial;
    }

    public Compania getCompania() {
        return compania;
    }

    public void setCompania(Compania compania) {
        this.compania = compania;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (saldoPK != null ? saldoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Saldo)) {
            return false;
        }
        Saldo other = (Saldo) object;
        if ((this.saldoPK == null && other.saldoPK != null) || (this.saldoPK != null && !this.saldoPK.equals(other.saldoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.tesla.domain.Saldo[ saldoPK=" + saldoPK + " ]";
    }
    
}
